<?php
include 'D:/dingjiangbbs/common/home.php';

//屏蔽notice错误
error_reporting(E_ALL ^ E_NOTICE);

//var_dump($_GET);


//获取 url 传过来的 id值
$uid   = $_GET['id'];
$lock  = $_GET['lock'];
//var_dump($uid,$lock);

if ($lock == 'j') {

	$data  = [
		'allowlogin' => 0,
		'bcount'     => 0
	];
}

if ($lock == 's') {

	$data = [
		'allowlogin' => 1
	];
}
//修改数据库user表中allowlogin字段
$table = DB_TABLE_USER;

$where = "uid=$uid";
$res_lock = update($link,$table,$data,$where);
//var_dump($res_lock);

if (!$res_lock) {
	exit('操作失败');
}

//输出,跳转页面
echo '操作成功';
header('refresh:2;url='.WEB_SITE.'admin_cg.php?bighead=2&cg_number=3');

